//
//  CommentTableViewCell.m
//  TodatPlay
//
//  Created by dllo on 16/9/5.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "CommentTableViewCell.h"
#import "SDAutoLayout.h"
@implementation CommentTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createlabel];
    }
    return self;
}

- (void)createlabel {
    self.commentLabel = [UILabel new];

    [self.contentView addSubview:self.commentLabel];
    self.commentLabel.font = [UIFont systemFontOfSize:13];
    self.commentLabel.textColor = [UIColor colorWithRed:0.000 green:0.325 blue:1.000 alpha:1.000];
    self.commentUserNameLabel.textColor = [UIColor colorWithRed:0.000 green:0.325 blue:1.000 alpha:1.000];

//   self.commentUserNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)];
//    _commentUserNameLabel.numberOfLines = 0;
//    _commentUserNameLabel.backgroundColor = [UIColor clearColor];
//    self.commentUserNameLabel.font = [UIFont systemFontOfSize:13];
//    NSString *userName = @"用户名:";
//    _commentUserNameLabel.textColor = [UIColor colorWithRed:0.000 green:0.325 blue:1.000 alpha:1.000];
//    _commentUserNameLabel.text = userName;
//    [self addSubview:_commentUserNameLabel];
    
//    self.commentUserNameLabel.sd_layout
//    .leftSpaceToView(self, 5)
//    .topSpaceToView(self, 10);
//    [self.commentUserNameLabel setupAutoWidthWithRightView:self.commentLabel rightMargin:5];
//    [self.commentUserNameLabel updateLayout];
    self.commentLabel.sd_layout
    .leftSpaceToView(self.commentUserNameLabel, 5)
    .topSpaceToView(self.contentView, 10)
    .rightSpaceToView(self.contentView, 5)
    .autoHeightRatio(0);
    
    [self setupAutoHeightWithBottomView:self.commentLabel bottomMargin:10];
    
}









- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
